﻿using System;
using System.Linq;
using System.Linq.Expressions;
using Webdiyer.AspNetCore;
using ZhongKeSite.Entity;

namespace ZhongKeSite.Repository
{
    public class MileStoneRepository : Repository<MileStone>, IMileStoneRepository
    {
        public MileStoneRepository(ZhongKeContext dbContext) : base(dbContext)
        {

        }

        public override PagedList<MileStone> GetPagedList(int pageIndex, int pageSize, Expression<Func<MileStone, bool>> predicate)
        {
            return _dbContext.MileStone.Where(predicate).OrderByDescending(m => m.PublishDate).ToPagedList(pageIndex, pageSize);
        }
    }
}
